%These two lines creates a new matrix for the red component and displays it
original_image_red_component = original_image(:,:,1);
imshow(original_image_red_component)
title("Red component of original image ",'Color','r')
red_component_dimensions = size(original_image_red_component)
imwrite(original_image_red_component,'red_component.bmp');
red_component_info = imfinfo("red_component.bmp");
fprintf(['The size of red component on disk is<strong> %d bytes</strong>, which is' ...
' one third the original image size\n\n'], red_component_info.FileSize);
The size of red component on disk is 2074678 bytes, which is one third the original image size
fprintf(['The sky appears to be dark in the red component as the sky has mostly' ...
' blue color\n']);
The sky appears to be dark in the red component as the sky has mostly blue color
fprintf(['We can deduce that the dark areas has less red component and the bright' ...
' areas has little red components such as the reflection of the sun on ' ...
'the snow\n']);
We can deduce that the dark areas has less red component and the bright areas has little red components such as the reflection of the sun on the snow
%These two lines creates a new matrix for the green component and displays it
original_image_green_component = original_image(:,:,2);
imshow(original_image_green_component)
title("Green component of original image ",'Color','g')
green_component_dimensions = size(original_image_green_component)
imwrite(original_image_green_component,'green_component.bmp');
green_component_info = imfinfo("green_component.bmp");
fprintf(['The size of green_component on disk is<strong> %d bytes</strong>, which' ...
' is one third the original image size\n\n'], green_component_info.FileSize);
The size of green_component on disk is 2074678 bytes, which is one third the original image size
fprintf(['The trees appears to be bright in the green component as they have green' ...
' color']);
The trees appears to be bright in the green component as they have green color
%These two lines creates a new matrix a new matrix for the blue component and
original_image_blue_component = original_image(:,:,3);
imshow(original_image_blue_component)
title("Blue component of original image ",'Color','b')
blue_component_dimensions = size(original_image_blue_component)
imwrite(original_image_blue_component,'blue_component.bmp');
blue_component_info = imfinfo("blue_component.bmp");
fprintf(['The size of blue_component on disk is <strong>%d bytes</strong>, which is' ...
' one third the original image size\n\n'], blue_component_info.FileSize);
The size of blue_component on disk is 2074678 bytes, which is one third the original image size
fprintf(['The sky appears bright in the blue component as the color of the sky in' ...
' the original image is mostly blue'])
The sky appears bright in the blue component as the color of the sky in the original image is mostly blue
psnr_decompressed_original_component = [0; 0; 0; 0;];
compressing_mat_at_m_equals_one = [1 0 0 0 0 0 0 0 ];
comp= @(block_struct) compressing_mat_at_m_equals_one* block_struct.data * ...
compressing_mat_at_m_equals_one';
mask_at_m_equals_one = [1 0 0 0 0 0 0 0
% for the red component at m = 1
red_component_in_double = im2double(original_image_red_component);
dct_red_component = dctmtx(8);
dct = @(block_struct) dct_red_component* block_struct.data * dct_red_component';
B_R1 = blockproc(red_component_in_double,[8 8],dct);
B2_R1 = blockproc(B_R1,[8 8],@(block_struct) mask_at_m_equals_one .* ...
comp_R1 = blockproc(B2_R1,[8 8],comp);
imwrite(comp_R1,'red_component_at_m_equals_one.bmp');
red_component_at_m_equals_one_info = imfinfo("red_component_at_m_equals_one.bmp");
fprintf(['The size of compressed red component at m = 1 on disk is ' ...
'<strong>%d bytes</strong>, which is too small compared to the' ...
' red component of the original image\n\n'], ...
red_component_at_m_equals_one_info.FileSize);
The size of compressed red component at m = 1 on disk is 33478 bytes, which is too small compared to the red component of the original image
%inverse 2-d dct to get the decompressed image of the red component at m = 1
invdct = @(block_struct) dct_red_component' * block_struct.data * ...
R1 = blockproc(B2_R1,[8 8],invdct);
title("Decompressed red component at m = 1 ",'Color','r')
xlabel('The size of the compressed red component at m = 1 equals 33478 bytes ')
psnr_decompressed_red_component_at_m_equals_one = psnr(R1,red_component_in_double)
psnr_decompressed_red_component_at_m_equals_one = 19.8695
% for the green component at m = 1
green_component_in_double = im2double(original_image_green_component);
dct_green_component = dctmtx(8);
dct = @(block_struct) dct_green_component* block_struct.data *...
B_G1 = blockproc(green_component_in_double,[8 8],dct);
B2_G1 = blockproc(B_G1,[8 8],@(block_struct) ...
mask_at_m_equals_one .* block_struct.data);
comp_G1 = blockproc(B2_G1,[8 8],comp);
imwrite(comp_G1,'green_component_at_m_equals_one.bmp');
green_component_at_m_equals_one_info = imfinfo("green_component_at_m_equals" + ...
fprintf(['The size of compressed green component at m = 1 on disk is' ...
' <strong>%d bytes</strong>, which is too small compared to the' ...
' green component of the original image\n\n'], ...
green_component_at_m_equals_one_info.FileSize);
The size of compressed green component at m = 1 on disk is 33478 bytes, which is too small compared to the green component of the original image
%inverse 2-d dct to get the decompressed image of the green component at m = 1
invdct = @(block_struct) dct_green_component' * ...
block_struct.data* dct_green_component;
G1 = blockproc(B2_G1,[8 8],invdct);
title("Decompressed green component at m = 1 ",'Color','g')
xlabel('The size of the compressed red component at m = 1 equals 33478 bytes ')
psnr_decompressed_green_component_at_m_equals_one = ...
psnr(G1,green_component_in_double)
psnr_decompressed_green_component_at_m_equals_one = 19.7613
% for the blue component at m = 1
blue_component_in_double = im2double(original_image_blue_component);
dct_blue_component = dctmtx(8);
dct = @(block_struct) dct_blue_component* block_struct.data * dct_blue_component';
B_B1 = blockproc(blue_component_in_double,[8 8],dct);
B2_B1 = blockproc(B_B1,[8 8],@(block_struct) ...
mask_at_m_equals_one .* block_struct.data);
comp_B1 = blockproc(B2_B1,[8 8],comp);
imwrite(comp_B1,'blue_component_at_m_equals_one.bmp');
blue_component_at_m_equals_one_info = imfinfo("blue_component_at_m_equals_one.bmp");
fprintf(['The size of compressed blue component at m = 1 on disk is' ...
' <strong>%d bytes</strong>, which is too small compared to the ' ...
' blue component of the original image\n\n'], ...
blue_component_at_m_equals_one_info.FileSize);
The size of compressed blue component at m = 1 on disk is 33478 bytes, which is too small compared to the blue component of the original image
%inverse 2-d dct to get the decompressed image of the blue component at m = 1
invdct = @(block_struct) dct_blue_component' * block_struct.data * dct_blue_component;
B1 = blockproc(B2_B1,[8 8],invdct);
title("Decompressed blue component at m = 1 ",'Color','b')
xlabel('The size of the compressed blue component at m = 1 equals 33478 bytes ')
psnr_decompressed_blue_component_at_m_equals_one = ...
psnr(B1,blue_component_in_double)
psnr_decompressed_blue_component_at_m_equals_one = 19.9629
%To get the colored image at m=1
comp_RGB1 = cat(3,comp_R1,comp_G1,comp_B1);
imwrite(comp_RGB1,'comp_original_component_at_m_equals_one.bmp');
compressed_original_component_at_m_equals_one_info = imfinfo("comp_original" + ...
"_component_at_m_equals_one.bmp");
fprintf(['The size of compressed original component at m = 1 on ' ...
'disk is <strong>%d bytes</strong>,' ...
' which is too small compared to the size of' ...
' the original image\n\n'], ...
compressed_original_component_at_m_equals_one_info.FileSize)
The size of compressed original component at m = 1 on disk is 97254 bytes, which is too small compared to the size of the original image
title("Decompressed rgb image at m = 1 ",'Color','k')
xlabel(['The size of the compressed orignal component at m = 1 equals ' ...
dimensions_of_RGB1 = size(RGB1)
fprintf(['We notice that the dimensions of the decompressed images is the same' ...
' as the original image']);
We notice that the dimensions of the decompressed images is the same as the original image
psnr_decompressed_original_component(1) = psnr(RGB1,original_image_in_double)
compressing_mat_at_m_equals_two = [1 1 0 0 0 0 0 0;
comp= @(block_struct) compressing_mat_at_m_equals_two* block_struct.data * ...
compressing_mat_at_m_equals_two';
mask_at_m_equals_two = [1 1 0 0 0 0 0 0
% for the red component at m = 2
red_component_in_double = im2double(original_image_red_component);
dct_red_component = dctmtx(8);
dct = @(block_struct) dct_red_component* block_struct.data * dct_red_component';
B_R2 = blockproc(red_component_in_double,[8 8],dct);
B2_R2 = blockproc(B_R2,[8 8],@(block_struct) mask_at_m_equals_two .* ...
comp_R2 = blockproc(B2_R2,[8 8],comp);
imwrite(comp_R2,'red_component_at_m_equals_two.bmp');
red_component_at_m_equals_two_info = imfinfo("red_component_at_m_equals_two.bmp");
fprintf(['The size of compressed red component at m = 2 on disk is ' ...
'<strong>%d bytes</strong>, which is too small compared to the ' ...
' red component of the original image\n\n'], ...
red_component_at_m_equals_two_info.FileSize);
The size of compressed red component at m = 2 on disk is 130678 bytes, which is too small compared to the red component of the original image
%inverse 2-d dct to get the decompressed image of the red component at m = 2
invdct = @(block_struct) dct_red_component' * block_struct.data * dct_red_component;
R2 = blockproc(B2_R2,[8 8],invdct);
title("Decompressed red component at m = 2 ",'Color','r')
xlabel('The size of the compressed red component at m = 2 equals 130678 bytes ')
psnr_decompressed_red_component_at_m_equals_two = psnr(R2,red_component_in_double)
psnr_decompressed_red_component_at_m_equals_two = 21.9229
% for the green component at m = 2
green_component_in_double = im2double(original_image_green_component);
dct_green_component = dctmtx(8);
dct = @(block_struct) dct_green_component* block_struct.data * dct_green_component';
B_G2 = blockproc(green_component_in_double,[8 8],dct);
B2_G2 = blockproc(B_G2,[8 8],@(block_struct) mask_at_m_equals_two .* block_struct.data);
comp_G2 = blockproc(B2_G2,[8 8],comp);
imwrite(comp_G2,'green_component_at_m_equals_two.bmp');
green_component_at_m_equals_two_info = imfinfo("green_component_at_m_equals_two.bmp");
fprintf(['The size of compressed green component at m = 2 on disk is ' ...
'<strong>%d bytes</strong>, which is too small compared to the ' ...
'green component of the original image\n\n'], ...
green_component_at_m_equals_two_info.FileSize);
The size of compressed green component at m = 2 on disk is 130678 bytes, which is too small compared to the green component of the original image
%inverse 2-d dct to get the decompressed image of the green component at m = 2
invdct = @(block_struct) dct_green_component' * block_struct.data * ...
G2 = blockproc(B2_G2,[8 8],invdct);
title("Decompressed green component at m = 2 ",'Color','g')
xlabel('The size of the compressed red component at m = 2 equals 130678 bytes ')
psnr_decompressed_green_component_at_m_equals_two = psnr(G2,green_component_in_double)
psnr_decompressed_green_component_at_m_equals_two = 21.8051
% for the blue component at m = 2
blue_component_in_double = im2double(original_image_blue_component);
dct_blue_component = dctmtx(8);
dct = @(block_struct) dct_blue_component* block_struct.data * dct_blue_component';
B_B2 = blockproc(blue_component_in_double,[8 8],dct);
B2_B2 = blockproc(B_B2,[8 8],@(block_struct) mask_at_m_equals_two .* ...
comp_B2 = blockproc(B2_B2,[8 8],comp);
imwrite(comp_B2,'blue_component_at_m_equals_two.bmp');
blue_component_at_m_equals_two_info = imfinfo("blue_component_at_m_" + ...
fprintf(['The size of compressed blue component at m = 2 on disk is' ...
'<strong> %d bytes</strong>, which is too small compared to the' ...
' blue component of the original image\n\n'], ...
blue_component_at_m_equals_two_info.FileSize);
The size of compressed blue component at m = 2 on disk is 130678 bytes, which is too small compared to the blue component of the original image
%inverse 2-d dct to get the decompressed image of the blue component at m = 2
invdct = @(block_struct) dct_blue_component' * block_struct.data * ...
B2 = blockproc(B2_B2,[8 8],invdct);
title("Decompressed blue component at m = 2 ",'Color','b')
xlabel('The size of the compressed blue component at m = 2 equals 130678 bytes ')
psnr_decompressed_blue_component_at_m_equals_two = psnr(B2,blue_component_in_double)
psnr_decompressed_blue_component_at_m_equals_two = 21.9764
%To get the colored image at m = 2
comp_RGB2 = cat(3,comp_R2,comp_G2,comp_B2);
imwrite(comp_RGB2,'comp_original_component_at_m_equals_two.bmp');
compressed_original_component_at_m_equals_two_info = imfinfo("comp_original_" + ...
"component_at_m_equals_two.bmp");
fprintf(['The size of compressed original component at m = 2 on disk is' ...
' <strong>%d bytes</strong>,' ...
' which is too small compared to the size of the ' ...
'original image\n\n'], ...
compressed_original_component_at_m_equals_two_info.FileSize)
The size of compressed original component at m = 2 on disk is 388854 bytes, which is too small compared to the size of the original image
title("Decompressed rgb image at m = 2 ",'Color','k')
xlabel(['The size of the compressed orignal component at m = 2 equals ' ...
dimensions_of_RGB2 = size(RGB2)
fprintf(['We notice that the dimensions of the decompressed images is the' ...
' same as the original image']);
We notice that the dimensions of the decompressed images is the same as the original image
psnr_decompressed_original_component(2) = psnr(RGB2,original_image_in_double)
compressing_mat_at_m_equals_three = [1 1 1 0 0 0 0 0;
comp= @(block_struct) compressing_mat_at_m_equals_three* block_struct.data * compressing_mat_at_m_equals_three';
mask_at_m_equals_three = [1 1 1 0 0 0 0 0
% for the red component at m = 3
red_component_in_double = im2double(original_image_red_component);
dct_red_component = dctmtx(8);
dct = @(block_struct) dct_red_component* block_struct.data * dct_red_component';
B_R3 = blockproc(red_component_in_double,[8 8],dct);
B2_R3 = blockproc(B_R3,[8 8],@(block_struct) mask_at_m_equals_three .* block_struct.data);
comp_R3 = blockproc(B2_R3,[8 8],comp);
imwrite(comp_R3,'red_component_at_m_equals_three.bmp');
red_component_at_m_equals_three_info = imfinfo("red_component_at_m_equals_three.bmp");
fprintf('The size of compressed red component at m = 3 on disk is <strong>%d bytes</strong>, which is too small compared to the red component of the original image\n\n', red_component_at_m_equals_three_info.FileSize);
The size of compressed red component at m = 3 on disk is 292678 bytes, which is too small compared to the red component of the original image
%inverse 2-d dct to get the decompressed image of the red component at m = 3
invdct = @(block_struct) dct_red_component' * block_struct.data * dct_red_component;
R3 = blockproc(B2_R3,[8 8],invdct);
title("Decompressed red component at m = 3 ",'Color','r')
xlabel('The size of the compressed red component at m = 3 equals 292678 bytes ')
psnr_decompressed_red_component_at_m_equals_three = psnr(R3,red_component_in_double)
psnr_decompressed_red_component_at_m_equals_three = 23.7740
% for the green component at m = 3
green_component_in_double = im2double(original_image_green_component);
dct_green_component = dctmtx(8);
dct = @(block_struct) dct_green_component* ...
block_struct.data * dct_green_component';
B_G3 = blockproc(green_component_in_double,[8 8],dct);
B2_G3 = blockproc(B_G3,[8 8],@(block_struct) ...
mask_at_m_equals_three .* block_struct.data);
comp_G3 = blockproc(B2_G3,[8 8],comp);
imwrite(comp_G3,'green_component_at_m_equals_three.bmp');
green_component_at_m_equals_three_info = imfinfo("green_component_at_m" + ...
fprintf(['The size of compressed green component at m = 3 on ' ...
'disk is <strong>%d bytes</strong>, which is too small compared' ...
' to the green component of the original image\n\n'], ...
green_component_at_m_equals_three_info.FileSize);
The size of compressed green component at m = 3 on disk is 292678 bytes, which is too small compared to the green component of the original image
%inverse 2-d dct to get the decompressed image of the green component at m = 3
invdct = @(block_struct) dct_green_component' * block_struct.data * dct_green_component;
G3 = blockproc(B2_G3,[8 8],invdct);
title("Decompressed green component at m = 3 ",'Color','g')
xlabel('The size of the compressed red component at m = 3 equals 292678 bytes ')
psnr_decompressed_green_component_at_m_equals_three = ...
psnr(G3,green_component_in_double)
psnr_decompressed_green_component_at_m_equals_three = 23.6670
% for the blue component at m = 3
blue_component_in_double = im2double(original_image_blue_component);
dct_blue_component = dctmtx(8);
dct = @(block_struct) dct_blue_component* block_struct.data * dct_blue_component';
B_B3 = blockproc(blue_component_in_double,[8 8],dct);
B2_B3 = blockproc(B_B3,[8 8],@(block_struct) mask_at_m_equals_three .* block_struct.data);
comp_B3 = blockproc(B2_B3,[8 8],comp);
imwrite(comp_B3,'blue_component_at_m_equals_three.bmp');
blue_component_at_m_equals_three_info = imfinfo("blue_component_at_m_equals_three.bmp");
fprintf(['The size of compressed blue component at m = 3 on disk is ' ...
'<strong>%d bytes</strong>, which is too small compared to the' ...
' blue component of the original image\n\n'], ...
blue_component_at_m_equals_three_info.FileSize);
The size of compressed blue component at m = 3 on disk is 292678 bytes, which is too small compared to the blue component of the original image
%inverse 2-d dct to get the decompressed image of the blue component at m = 3
invdct = @(block_struct) dct_blue_component' * block_struct.data ...
B3 = blockproc(B2_B3,[8 8],invdct);
title("Decompressed blue component at m = 3 ",'Color','b')
xlabel('The size of the compressed blue component at m = 3 equals 292678 bytes ')
psnr_decompressed_blue_component_at_m_equals_three = ...
psnr(B3,blue_component_in_double)
psnr_decompressed_blue_component_at_m_equals_three = 23.8248
%To get the colored image at m=3
comp_RGB3 = cat(3,comp_R3,comp_G3,comp_B3);
imwrite(comp_RGB3,'comp_original_component_at_m_equals_three.bmp');
compressed_original_component_at_m_equals_three_info = imfinfo("comp_original_" + ...
"component_at_m_equals_three.bmp");
fprintf(['The size of compressed original component at m = 3 on disk is' ...
' <strong>%d bytes</strong>,' ...
' which is too small compared to the size of the ' ...
'original image\n\n'], ...
compressed_original_component_at_m_equals_three_info.FileSize)
The size of compressed original component at m = 3 on disk is 874854 bytes, which is too small compared to the size of the original image
title("Decompressed rgb image at m = 3 ",'Color','k')
xlabel(['The size of the compressed orignal component at m = 3 equals ' ...
dimensions_of_RGB3 = size(RGB3)
fprintf(['We notice that the dimensions of the decompressed ' ...
'images is the same as the original image']);
We notice that the dimensions of the decompressed images is the same as the original image
psnr_decompressed_original_component(3) = ...
psnr(RGB3,original_image_in_double)
19.8638
21.9009
23.7548
0
compressing_mat_at_m_equals_four = [1 1 1 1 0 0 0 0;
comp= @(block_struct) compressing_mat_at_m_equals_four* block_struct.data * compressing_mat_at_m_equals_four';
mask_at_m_equals_four = [1 1 1 1 0 0 0 0
% for the red component at m = 4
red_component_in_double = im2double(original_image_red_component);
dct_red_component = dctmtx(8);
dct = @(block_struct) dct_red_component* block_struct.data * dct_red_component';
B_R4 = blockproc(red_component_in_double,[8 8],dct);
B2_R4 = blockproc(B_R4,[8 8],@(block_struct) ...
mask_at_m_equals_four .* block_struct.data);
comp_R4 = blockproc(B2_R4,[8 8],comp);
imwrite(comp_R4,'red_component_at_m_equals_four.bmp');
red_component_at_m_equals_four_info = imfinfo("red_component_at" + ...
fprintf(['The size of compressed red component at m = 4 on disk is' ...
' <strong>%d bytes</strong>, which is too small compared to the' ...
' red component of the original image\n\n'], ...
red_component_at_m_equals_four_info.FileSize);
The size of compressed red component at m = 4 on disk is 519478 bytes, which is too small compared to the red component of the original image
%inverse 2-d dct to get the decompressed image of the red component at m = 4
invdct = @(block_struct) dct_red_component' * block_struct.data ...
R4 = blockproc(B2_R4,[8 8],invdct);
title("Decompressed red component at m = 4 ",'Color','r')
xlabel('The size of the compressed red component at m = 3 equals 51478 bytes ')
psnr_decompressed_red_component_at_m_equals_four = ...
psnr(R4,red_component_in_double)
psnr_decompressed_red_component_at_m_equals_four = 25.9191
% for the green component at m = 4
green_component_in_double = im2double(original_image_green_component);
dct_green_component = dctmtx(8);
dct = @(block_struct) dct_green_component* block_struct.data ...
B_G4 = blockproc(green_component_in_double,[8 8],dct);
B2_G4 = blockproc(B_G4,[8 8],@(block_struct) ...
mask_at_m_equals_four .* block_struct.data);
comp_G4 = blockproc(B2_G4,[8 8],comp);
imwrite(comp_G4,'green_component_at_m_equals_four.bmp');
green_component_at_m_equals_four_info = imfinfo("green_component_at" + ...
fprintf(['The size of compressed green component at m = 4 on disk is' ...
' <strong>%d bytes</strong>, which is too small compared to the ' ...
' green component of the original image\n\n'], ...
green_component_at_m_equals_four_info.FileSize);
The size of compressed green component at m = 4 on disk is 519478 bytes, which is too small compared to the green component of the original image
%inverse 2-d dct to get the decompressed image of the green component at m = 4
invdct = @(block_struct) dct_green_component' * block_struct.data ...
G4 = blockproc(B2_G4,[8 8],invdct);
title("Decompressed green component at m = 4 ",'Color','g')
xlabel('The size of the compressed red component at m = 4 equals 519478 bytes ')
psnr_decompressed_green_component_at_m_equals_four = ...
psnr(G4,green_component_in_double)
psnr_decompressed_green_component_at_m_equals_four = 25.8200
% for the blue component at m = 4
blue_component_in_double = im2double(original_image_blue_component);
dct_blue_component = dctmtx(8);
dct = @(block_struct) dct_blue_component* block_struct.data * dct_blue_component';
B_B4 = blockproc(blue_component_in_double,[8 8],dct);
B2_B4 = blockproc(B_B4,[8 8],@(block_struct) ...
mask_at_m_equals_four .* block_struct.data);
comp_B4 = blockproc(B2_B4,[8 8],comp);
imwrite(comp_B4,'blue_component_at_m_equals_four.bmp');
blue_component_at_m_equals_four_info = imfinfo("blue_component" + ...
"_at_m_equals_four.bmp");
fprintf(['The size of compressed blue component at m = 4 on disk ' ...
'is <strong>%d bytes</strong>, which is too small compared to' ...
' the blue component of the original image\n\n'], ...
blue_component_at_m_equals_four_info.FileSize);
The size of compressed blue component at m = 4 on disk is 519478 bytes, which is too small compared to the blue component of the original image
%inverse 2-d dct to get the decompressed image of the blue component at m = 4
invdct = @(block_struct) dct_blue_component' * ...
block_struct.data * dct_blue_component;
B4 = blockproc(B2_B4,[8 8],invdct);
title("Decompressed blue component at m = 4 ",'Color','b')
xlabel('The size of the compressed blue component at m = 4 equals 519478 bytes ')
psnr_decompressed_blue_component_at_m_equals_four = ...
psnr(B4,blue_component_in_double)
psnr_decompressed_blue_component_at_m_equals_four = 25.9715
%To get the colored image at m=4
comp_RGB4 = cat(3,comp_R4,comp_G4,comp_B4);
imwrite(comp_RGB4,'comp_original_component_at_m_equals_four.bmp');
compressed_original_component_at_m_equals_four_info = imfinfo("comp_original" + ...
"_component_at_m_equals_four.bmp");
fprintf(['The size of compressed original component at m = 4 on' ...
' disk is <strong>%d bytes</strong>,' ...
' which is too small compared to the size of the original image\n\n'], ...
compressed_original_component_at_m_equals_four_info.FileSize)
The size of compressed original component at m = 4 on disk is 1555254 bytes, which is too small compared to the size of the original image
title("Decompressed rgb image at m = 4 ",'Color','k')
xlabel(['The size of the compressed orignal component at m = 4 equals ' ...
dimensions_of_RGB4 = size(RGB4)
fprintf(['We notice that the dimensions of the decompressed images' ...
' is the same as the original image']);
We notice that the dimensions of the decompressed images is the same as the original image
psnr_decompressed_original_component(4) = psnr(RGB4,original_image_in_double)
19.8638
21.9009
23.7548
25.9031